package com.example.aop.aspect;

import com.example.aop.annotation.TestAnnotation;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2021/1/29 23:15
 */
@Aspect
@Component
public class TestAspect
{
    @Pointcut("@annotation(com.example.aop.annotation.TestAnnotation)")
    public void test()
    {
    }

    @Before("@annotation(testAnnotation)")
    public void action000(TestAnnotation testAnnotation)
    {
        System.out.println("Annotation value : " + testAnnotation.value());
        System.out.println("Annotation description : " + testAnnotation.description());
        System.out.println("this is TestAspect.action()");
    }
}
